﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace p
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            DataSet dataset11 = new DataSet();
            CrystalReport2 ocr = new CrystalReport2();
            SqlConnection myconn = new SqlConnection("Data Source=.;Initial Catalog=db_2012;Integrated Security=True");
            myconn.Open();
            string sqlstr = "select*from employee";
            SqlDataAdapter ad = new SqlDataAdapter(sqlstr,myconn);
            ad.Fill(dataset11);
            ocr.SetDataSource(dataset11);
            this.crystalReportViewer1.ReportSource = ocr;
            
        }

        private void crystalReportViewer1_Load(object sender, EventArgs e)
        {

        }

   

     
    }
}
